package com.itheima.itheima_health.controller.user;

import com.itheima.itheima_health.constant.MessageConstant;
import com.itheima.itheima_health.entity.Result;
import com.itheima.itheima_health.pojo.Order;
import com.itheima.itheima_health.service.CheckRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/checkrecord")
public class CheckRecordController {
    @Autowired
    private CheckRecordService checkRecordService;

    @RequestMapping("/findByMemberId")
    public Result findByMemberId(Integer memberId) {
        try {
            List<Order> list = checkRecordService.findByMemberId(memberId);
            return new Result(true, "查询成功", list);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false, "查询失败");
        }
    }
}